﻿using System;
using System.Collections.Generic;
using System.Linq;
using MoreExtentions;

namespace MoreExtentions
{
    public static partial class Linq
    {
        public static void AddList<T>(this IList<T> thisCollection, params IList<T>[] collections)
        {
            collections.SelectMany(collection => collection).ForEach(thisCollection.Add);
        }

        public static void AddList<T>(this ICollection<T> source, Func<T, bool> predicate, params IList<T>[] collections)
        {
            collections.SelectMany(collection => collection).Where(predicate).ForEach(source.Add);
        }
    }
}